package com.ling.sbbyyds.request.robot;

import com.ling.sbbyyds.interaction.chatgpt.RobotParam;
import com.ling.sbbyyds.interaction.chatgpt.RobotResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * GPT API请求
 * @author ling
 */
@FeignClient(name = "GPT", url = "https://api.openai.com")
public interface RobotGPT {

    /**
     * 调用GPT语言模型进行聊天
     * @param param 聊天参数
     * @return 返回回答信息
     */
    @PostMapping(value = "/v1/completions",headers={"Authorization = ${robot.chatGPT.token}"})
    public RobotResponseData robotQuestions(RobotParam param);
}